/*缓存数据从这里走 统一管理 避免错乱*/




function setUser(userId) {
  wx.setStorage({
    key: "userId",
    data: userId
  })
  var globalData = getApp().globalData;
  globalData.userId = userId
}



function getUserId() {
  var userId = wx.getStorageSync('userId')
  return userId
}

function clearLocalhost() {
  wx.clearStorage()
  var appInstance = getApp()
  appInstance.globalData.userId = ''
}
module.exports = {
  getUserId: getUserId,
  clearLocalhost: clearLocalhost,
  setUser:setUser
}